home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / areuh.tar / areuh / cpy / a2lex.c next >
C/C++ Source or Header  |  1990-10-10  |  641b  |  40 lines

  1. /*
  2.  * Authors :
  3.  *   Pierre DAVID (pda@masi.ibp.fr or pda@frunip62.bitnet)
  4.  *   Janick TAILLANDIER
  5.  *
  6.  * This program can be freely used or distributed as long as this
  7.  * note is kept.
  8.  *
  9.  * This program is provided "as is".
  10.  */
  11.  
  12. #include "copy.h"
  13.  
  14. char outname [100] ;
  15. FILE *fpdev ;
  16.  
  17. init ()
  18. {
  19. #ifdef unix
  20.     fpdev = stdout ;
  21. #else
  22.     sprintf (outname, "%s.lex", file) ;
  23.     if ((fpdev = fopen (outname, "wb")) == NULL)
  24.         error (ERROPN, outname) ;
  25. #endif
  26. }
  27.  
  28. output (c)
  29. uchar c ;
  30. {
  31.     putc ((int) c, fpdev) ;
  32.     if (ferror (fpdev)) error (ERRWRT, outname) ;
  33. }
  34.  
  35. term ()
  36. {
  37.     if (fclose (fpdev))
  38.         error (ERRCLO, outname) ;
  39. }
  40.